<template>
  <div class="node">
    <div class="node-item" v-for="item in nodeList" :key="item.type" @mousedown.prevent="dragNode(item)">
      <div :class="['icon', item.icon]" :title="item.text"></div>
    </div>
  </div>
</template>

<script setup lang="ts">
import LNode from '../node/index';
import {useAddNode} from "../util/hook.ts";
import {NodeClassType} from "../util/types.d.ts";

const nodeList: NodeClassType[] = LNode.sort((a: NodeClassType, b: NodeClassType) => a.order - b.order);
function dragNode(node: NodeClassType) {
  useAddNode(node);
}
</script>

<style scoped>

</style>
